﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Projekte.master" CodeBehind="projekt_uebersicht_intern.aspx.vb" Inherits="PMS_Linq.projekt_uebersicht_intern" 
    title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">
    <asp:GridView ID="gv_projektuebersicht_intern" runat="server" Height="170px" 
        HorizontalAlign="Center" Width="607px" AllowSorting="True" 
          onselectedindexchanged = "bla"
        style="margin-left: 0px" AllowPaging="True" 
        DataSourceID="SqlDataSource1" AutoGenerateColumns="False" PageSize="50" 
    EnableModelValidation="True">
        <RowStyle HorizontalAlign="Center" />
        <Columns>
            <asp:CommandField SelectText="Details" ShowCancelButton="False" 
                ShowSelectButton="True" />
            <asp:BoundField DataField="Projektname" HeaderText="Projektname" 
                SortExpression="Projektname" />
            <asp:BoundField DataField="Kunde" HeaderText="Kunde" SortExpression="Kunde" />
            <asp:BoundField DataField="Schema" HeaderText="Schema" 
                SortExpression="Schema" />
            <asp:BoundField DataField="Branche" HeaderText="Branche" 
                SortExpression="Branche" />
            <asp:BoundField DataField="Geleistet" HeaderText="Geleistet" ReadOnly="True" 
                SortExpression="Geleistet" DataFormatString="{0:F1}" />
            <asp:BoundField DataField="Angeboten" HeaderText="Angeboten" ReadOnly="True" 
                SortExpression="Angeboten" DataFormatString="{0:F1}" />
        </Columns>
        <HeaderStyle HorizontalAlign="Center" />
     
    </asp:GridView>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:PMSConnectionString %>" 
        
    
    
        
    
    SelectCommand="SELECT Projekt.Name AS Projektname, Kunde.Name AS Kunde, Projekt.Projektschema AS [Schema], Kunde.Branche, SUM(Report.Dauer) / 8 AS Geleistet, projekte_geleistet.angeboten AS Angeboten FROM Projekt INNER JOIN Kunde ON Projekt.KundeID = Kunde.ID INNER JOIN Phase ON Projekt.ID = Phase.Projekt_ID INNER JOIN Report ON Phase.Id = Report.PhasenID INNER JOIN projekte_geleistet ON Projekt.ID = projekte_geleistet.projektid WHERE (Projekt.Projekt_extern_intern = 1) AND (Report.Angenommen_pl = 1) AND (Projekt.status IS NULL OR Projekt.status = 'Läuft') GROUP BY Kunde.Branche, Projekt.Projektschema, Projekt.Name, Kunde.Name, projekte_geleistet.angeboten"></asp:SqlDataSource>
    <p>
        &nbsp;</p>
    <p>
    </p>
    <p>
    </p>
    <p>
    </p>
    <p>
    </p>
</asp:Content>
